package com.sofwin.service.impl.contents;

import com.github.pagehelper.PageInfo;
import com.sofwin.mapper.CHistoryMainMapper;
import com.sofwin.pojo.CHistoryMain;
import com.sofwin.pojo.CHistoryMainExample;
import com.sofwin.service.contents.CHistoryMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: authority-management-system.git
 * @description: TODO
 * @author: Mr.Gao
 * @create: 2021-04-26 09:30
 **/
@Service
public class CHistoryMainServiceImpl implements CHistoryMainService {

    @Autowired
    private CHistoryMainMapper mainMapper;


    @Override
    public PageInfo<CHistoryMain> selectAll(CHistoryMain cm) {
        CHistoryMainExample ex = new CHistoryMainExample();
        CHistoryMainExample.Criteria criteria = ex.createCriteria();
        criteria.andInfoIdEqualTo(cm.getInfoId());
        List<CHistoryMain> cHistoryMains = mainMapper.selectByExample(ex);
        return new PageInfo<CHistoryMain>(cHistoryMains);
    }

}
